package com.cwises.action.order;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

import com.core.base.BaseAction;
import com.cwises.entity.order.Order;
import com.cwises.entity.system.user.UserInfoManager;
import com.cwises.service.order.OrderService;
import com.orm.Page;

@Controller
public class OrderAction extends BaseAction {
	
	@Resource(name = "orderService")
	private OrderService orderService;
	
    private Order order;
	private Page<Order> page;
	
    /* 当前页号及每页数 */
    private int currentPage;
    private int pageSize;
    
    private String actionTitle="订单管理";
    
	public String findList(){
		page = new Page<Order>();
        //设置当前页
        page.setCurrentPage(currentPage);
        if(order==null){
        	order=new Order();
        }
        order.setShop_id(getShopId());
        page = orderService.findByCondition("findAll", order, page);
		return "success";
	}
	
	public String gotoDetail(){
		String id=getParameter("id");
		order = orderService.findById(id);
		return "success";
	}
	
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public String getActionTitle() {
		return actionTitle;
	}

	public void setActionTitle(String actionTitle) {
		this.actionTitle = actionTitle;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public Page<Order> getPage() {
		return page;
	}

	public void setPage(Page<Order> page) {
		this.page = page;
	}
	
}
